@clevertask/scribe 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/dist/browser-BJWkU9cc.js +2106 -0
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/components/Menu/BarMenu.d.ts +1 -0
- package/dist/components/Menu/BarMenu.js +38 -36
- package/dist/components/Menu/BubbleMenu.js +1 -1
- package/dist/components/Scribe/extension/emoji/EmojiList.d.ts +1 -0
- package/dist/components/Scribe/extension/emoji/EmojiList.js +35 -0
- package/dist/components/Scribe/extension/emoji/suggest.d.ts +16 -0
- package/dist/components/Scribe/extension/emoji/suggest.js +40 -0
- package/dist/components/Scribe/extension/extension-link.js +208 -200
- package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
- package/dist/components/Scribe/extension/index.js +30 -24
- package/dist/components/Scribe/extension/math-extension.js +1 -1
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +7 -5
- package/dist/components/Scribe/extension/slashCommand/index.js +4 -153
- package/dist/components/Scribe/extension/slashCommand/renderItems.d.ts +1 -1
- package/dist/components/Scribe/extension/slashCommand/renderItems.js +14 -14
- package/dist/components/Scribe/index.d.ts +1 -0
- package/dist/components/Scribe/index.js +69 -75
- package/dist/index-BqFHWqw6.js +156 -0
- package/dist/{index-C3_lI_rP.js → index-C_aWB8qt.js} +449 -427
- package/dist/index-CasgquAq.js +39381 -0
- package/dist/{index-Gm-3o3nq.js → index-DeZ8laak.js} +1124 -1083
- package/dist/main.css +95 -5
- package/dist/{turndown.browser.es-BSoGafvq.js → turndown.browser.es-C1wFFc_i.js} +342 -334
- package/dist/utils/create-scribe-editor.js +2 -2
- package/dist/utils/html-to-markdown.js +1 -1
- package/dist/utils/markdown-to-html.js +1 -1
- package/package.json +33 -31
- package/dist/browser-DEobZXxB.js +0 -2099
- package/dist/index-NRgJVTH-.js +0 -7576
package/README.md
CHANGED
|
@@ -68,6 +68,28 @@ function App() {
|
|
|
68
68
|
}
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
+
### With Dark Mode
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import "@clevertask/scribe/dist/main.css";
|
|
75
|
+
import { Scribe, ScribeOnChangeContents } from "@clevertask/scribe";
|
|
76
|
+
|
|
77
|
+
function App() {
|
|
78
|
+
const editor = useRef<ScribeRef>(null);
|
|
79
|
+
|
|
80
|
+
const resetContent = useCallback(() => {
|
|
81
|
+
editor.current.resetContent();
|
|
82
|
+
}, []);
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<>
|
|
86
|
+
<Scribe darkMode />
|
|
87
|
+
<button onClick={resetContent}>Reset content</button>
|
|
88
|
+
</>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
71
93
|
## Props
|
|
72
94
|
|
|
73
95
|
| Prop | Type | Default | Description |
|
|
@@ -85,6 +107,7 @@ function App() {
|
|
|
85
107
|
| `mainContainerStyle` | `React.CSSProperties` | `undefined` | You can send a CSS object to style the main editor container |
|
|
86
108
|
| `mainContainerClassName` | `string` | `undefined` | The same idea of `mainContainerStyle` but with classes. |
|
|
87
109
|
| `onKeyDown` | `KeyboardEventHandler` | `undefined` | A callback function that is triggered when a key is pressed within the editor. This allows you to handle custom keyboard shortcuts. For example, you can use this prop to implement a "send message" functionality when `Ctrl + Enter` is pressed. |
|
|
110
|
+
| `darkMode` | `boolean` | `false` | You can switch the darkMode value to change the text editor's theme |
|
|
88
111
|
|
|
89
112
|
## Helper Functions
|
|
90
113
|
|